All Questions
6 questions
5votes
1answer
234views
Building an efficient bubble sort function
I've been asked to create a bubble sort function that checks whether the array has been filled sorted before all passes are complete, thereby avoiding unnecessary passes. This is to involve "...
1vote
1answer
212views
Search/sort/create functionality, implements bubblesort and sequential search
I've moved my main() to the bottom of the code block in order to fit it all in one class for this submission. Is there a better way to do it? ...
2votes
1answer
2kviews
Binary HeapSort and Ternary HeapSort implementation
This is my take on binary and ternary heapsort implementation for a university assignment. The code works but I wonder if there are any mistakes or things to improve. ...
4votes
3answers
2kviews
Sorting strings in a one dimensional array
What are the better solutions possible? I have a character array with different strings. There is a max size for the strings. In case a string is smaller than max size remaining places are filled ...
17votes
7answers
143kviews
Finding repeating numbers in an array
I want to search through an array of n numbers and find the numbers that are repeated. So far I have this code, which does the job, but I find it to be a rather cumbersome method, but I can't seem to ...
1vote
4answers
307views
Insertion vs Selection
I currently have a selection sorting algorithm, but need some help turning it into a insertion sort, I understand a insertion sort if faster? The hand array is full, and it needs to sort from lowest ...